import java.util.*;


public class SPartition {
	
	public static Iterator<int[]> generateCombinations(final int n, final int k) {
		assert k>0;
		assert k<=n;
		return new Iterator<int[]>() {
			int[] nxt = new int[k];		
			{
				for (int i=0; i<nxt.length; i++) nxt[i] = i;
			}
			
			
			public boolean hasNext() {				
				return nxt != null;
			}
			
			public int[] next() {
				int[] ret = nxt.clone();
				if (ret.length == 0 || ret[0] == n-k) {
					nxt = null;
				} else {
					int pos = -1;
					for (int i=0; i<k-1; i++) {
						if (nxt[i] < nxt[i+1]-1) {
							pos = i;
							break;
						}
					}
					if (pos == -1) pos = k-1;
					
					for (int i=0; i<pos; i++) {
						nxt[i] = i;
					}
					nxt[pos]++;
					
				}
				return ret;
			}
			
			public void remove() {
				throw new UnsupportedOperationException();
			}};
	}
	
	
	char[] str;
	int nx, no; 
	char[] cur;
	
	final static int factor = 41;
	long[] arr = new long[(factor+1)*(factor+1)/4];
	
	static final long[] ethalon = new long[factor*factor*factor];
	static {
		Arrays.fill(ethalon, -1);
	}
	
	
	
	char[] convertToStr(int[] combin) {
		char[] res = new char[nx+no];
		int c = 0, p = 0;
		while (c < res.length) {
			 if (p < combin.length && c == combin[p]) {
				 res[c++] = 'x';
				 p++;
			 } else {
				 res[c++] = 'o';
			 }
		}
		return res;
	}
	
	long rec(int pos, int p1, int p2) {
		int idx = (factor+1)/2*p1 + p2;
		if (arr[idx] == -1) {			
			if (p1 == nx + no && p2 == nx+no && pos == str.length) arr[idx] = 1;
			else if (pos == str.length) arr[idx] = 0;
			else {
				arr[idx] = 0;
				if (p1 < nx + no && cur[p1] == str[pos]) arr[idx] += rec(pos+1, p1+1, p2); 
				if (p2 < nx + no && cur[p2] == str[pos]) arr[idx] += rec(pos+1, p1, p2+1);
			}
		}
		return arr[idx];
	}
	
	public long getCount(String s) {
		str = s.toCharArray();
		no = 0;
		for (char c: s.toCharArray()) {
			if (c == 'o') {
				no++;
			}
		}
		if (no % 2 != 0) return 0;
		
		nx = (s.length()-no)/2;
		no/=2;
		
		long res = 0;
		for (Iterator<int[]> it = generateCombinations(nx+no, nx); it.hasNext();) {
			cur = convertToStr(it.next());
			Arrays.fill(arr, -1);
			//arr = new long[factor*(factor+1)*(factor+1)/4];
			//System.arraycopy(ethalon, 0, arr, 0, ethalon.length);
			res += rec(0, 0, 0);
		}
		
		return res;
	}

}
